//
//  NavBarConfigure.swift
//  Extend
//
//  Created by shufang zou on 2017/8/4.
//  Copyright © 2017年 敬信. All rights reserved.
//

public class NavBarConfigure {

    var bgColor: UIColor?;
    var scriptColor: UIColor?;
    var scriptFont: UIFont?;
    var titleFont: UIFont?;
    var titleColor: UIColor?;
    var height: Int = 0;
    var imageCoordinate: CGRect?;
    var edgeSpace: CGFloat = 0;
    var startCoordinate: CGRect?;

    fileprivate init() {

    }

    public class func newBuilder() -> NavBarConfigBuilder {
        return NavBarConfigBuilder();
    }
}

public class NavBarConfigBuilder {

    var bgColor: UIColor?;
    var scriptColor: UIColor?;
    var scriptFont: UIFont?;
    var titleFont: UIFont?;
    var titleColor: UIColor?;
    var height: Int = 0;
    var imageCoordinate: CGRect?;
    var edgeSpace: CGFloat = 0;
    var startCoordinate: CGRect?;

    fileprivate init() {
        
    }

    public func bgColor(_ color: UIColor) -> Self {
        bgColor = color;
        return self;
    }

    public func scriptColor(_ color: UIColor) -> Self {
        scriptColor = color;
        return self;
    }

    public func scriptFont(_ font: UIFont) -> Self {
        scriptFont = font;
        return self;
    }

    public func titleFont(_ font: UIFont) -> Self {
        titleFont = font;
        return self;
    }

    public func titleColor(_ color: UIColor) -> Self {
        titleColor = color;
        return self;
    }

    public func barheight(_ h: Int) -> Self {
        height = h;
        return self;
    }

    public func imageCoordinate(_ image: CGRect) -> Self {
        imageCoordinate = image;
        return self;
    }

    public func edgeSpace(_ space: CGFloat) -> Self {
        edgeSpace = space;
        return self;
    }

    public func startCoordinate(_ start: CGRect) -> Self {
        startCoordinate = start;
        return self;
    }


    public func build() -> NavBarConfigure {
        let configure = NavBarConfigure();
        configure.bgColor = bgColor;
        configure.scriptColor = scriptColor;
        configure.scriptFont = scriptFont;
        configure.titleFont = titleFont;
        configure.titleColor = titleColor;
        configure.height = height;
        configure.imageCoordinate = imageCoordinate;
        configure.startCoordinate = startCoordinate;
        configure.edgeSpace = edgeSpace;

        return configure;
    }
}
